# Contributor: Florian Heigl <florian.heigl@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=nvme-cli
pkgver=2.7.1
pkgrel=0
pkgdesc="NVM-Express user space tooling for Linux"
arch="all"
url="https://github.com/linux-nvme/nvme-cli"
license="GPL-2.0-or-later"
makedepends="
	bash
	libnvme-dev
	linux-headers
	meson
	util-linux-dev
	uuidgen
	zlib-dev
	"
checkdepends="
	py3-nose2
	"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	$pkgname-zsh-completion
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/linux-nvme/nvme-cli/archive/v$pkgver.tar.gz"
options="!check" # needs pci nvme stuff

build() {
	abuild-meson \
		-Db_lto=true \
		-Ddocs=man \
		-Dudevrulesdir=/usr/lib/udev/rules.d/ \
		. output
	meson compile -C output
}

check() {
	meson test --print-errorlogs --no-rebuild -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	rm -rf "$pkgdir"/usr/lib/systemd
}

sha512sums="
6a9f3574dfd4375e6f7a76ed95f698efb26da5b72a490579caeba9d46c4811ae31650844e0a0e1047dc627158d5ffbdc020112a5059d3195e7eadff902b70b19  nvme-cli-2.7.1.tar.gz
"
